home *** CD-ROM | disk | FTP | other *** search
- ; Name
- ; OpenScreenPatch.s
- ;
- ; Project
- ; OpenScreenPatch
- ;
- ; Version
- ; Version 1.2
- ;
- ; Synopsis
- ; Just a quick hack to make output a little nicer
- ;
- ; Notes
- ; -
-
-
-
- start:
- movem.l d0-d7/a0-a6,-(a7)
-
- move.l 4,a6
- move.l a6,sysbase
-
- move.l #gfxname,a1 ; Open Gfx-Library
- move.l #37,d0
- jsr -552(a6)
- move.l d0,gfxbase
- beq gfxerror
-
- move.l #intuitionname,a1 ; Open Intuition-Library
- move.l #37,d0
- jsr -552(a6)
- move.l d0,intuitionbase
- beq intuierror
-
- bsr installpatch
- tst d0
- beq close
-
- wait:
- move.l sysbase,a6
- move.l #%1000000000000,d0 ; Wait() for CTRL-C
- jsr -318(a6)
-
- move.l intuitionbase,a6 ; Test if somebody else
- cmp.l #myopenscreen,-198+2(a6); has patched intuition's
- beq nootherospatch ; OpenScreen ()
- move.l #0,a0
- jsr -96(a6)
- bra.w wait
- nootherospatch:
-
- move.l intuitionbase,a6 ; Test if somebody else
- cmp.l #myopenscreentags,-612+2(a6)
- beq nootherostpatch ; has patched OpenScrenTags()
- move.l #0,a0
- jsr -96(a6)
- bra.w wait
- nootherostpatch:
-
- bsr removepatch
-
- close:
- move.l intuitionbase,a1
- jsr -414(a6)
- intuierror:
- move.l gfxbase,a1
- jsr -414(a6)
- gfxerror:
- movem.l (a7)+,d0-d7/a0-a6
- moveq #0,d0
- rts
-
-
-
- ; Call OpenScreenTags and set Genlock bit afterwards
-
- myopenscreentags:
- move.l a2,-(a7) ; save a2
-
- move.l oldopenscreentags,a2
- jsr (a2)
- move.l d0,a2
- tst.l d0
- beq myopenscreentagsreturn
-
- movem.l d0-d7/a0-a6,-(a7)
-
- move.l 48(a2),a0
- move.l gfxbase,a6
- move.l #vctags,a1
- jsr -708(a6) ; Call VideoControl(a0,a1)
-
- move.l intuitionbase,a6
- jsr -384(a6) ; Call RemakeDisplay ()
-
- movem.l (a7)+,d0-d7/a0-a6
- myopenscreentagsreturn:
- move.l (a7)+,a2
- rts
-
-
-
- ; Call OpenScreen and set Genlock bit afterwards
-
- myopenscreen:
- move.l a1,-(a7)
- move.l oldopenscreen,a1
- jsr (a1)
- move.l d0,a1
- tst.l d0
- beq myopenscreenreturn
-
- movem.l d0-d7/a0-a6,-(a7)
-
- move.l 48(a1),a0
- move.l gfxbase,a6
- move.l #vctags,a1
- jsr -708(a6) ; Call VideoControl(a0,a1)
-
- move.l intuitionbase,a6
- jsr -384(a6) ; Call RemakeDisplay ()
-
- movem.l (a7)+,d0-d7/a0-a6
- myopenscreenreturn:
- move.l (a7)+,a1
- rts
-
-
-
-
- ; Install Patch via SetFunction ()
-
- installpatch:
- move.l sysbase,a6
- move.l intuitionbase,a1
- move.l #-198,a0
- move.l #myopenscreen,d0
- jsr -420(a6)
- move.l d0,oldopenscreen
-
- move.l intuitionbase,a1
- move.l #-612,a0
- move.l #myopenscreentags,d0
- jsr -420(a6)
- move.l d0,oldopenscreentags
- rts
-
-
- ; Remove Patch via SetFunction ()
-
- removepatch:
- move.l sysbase,a6
- move.l #-198,a0
- move.l oldopenscreen,d0
- move.l intuitionbase,a1
- jsr -420(a6)
-
- move.l #-612,a0
- move.l oldopenscreentags,d0
- move.l intuitionbase,a1
- jsr -420(a6)
- rts
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- oldopenscreen: dc.l 0
- oldopenscreentags: dc.l 0
-
- dc.b 0,"$VER: OpenScreenPatch 1.2 (13.02.95)",0
- gfxname: dc.b "graphics.library",0
- intuitionname: dc.b "intuition.library",0
-
- even
-
- sysbase: dc.l 4
- intuitionbase: dc.l 4
- gfxbase: dc.l 4
-
- vctags: dc.l $80000005,1 ; Tags : (BORDERBLANK,TRUE)
- dc.l 0,0
-
- END
-
-
-
-
-
-